//
// Created by root on 9/12/25.
//

#ifndef UTILS_H
#define UTILS_H

#include "otl_ffmpeg.h"
#include <vector>
#include <string>
#ifdef HAVE_TOPS_FFMPEG
#include "TopsInference/TopsInferRuntime.h"
#endif

namespace tops_utils {
    // 将AVFrame转换为cv::Mat并保存为JPG
    bool av_frame_opencv_save(int buffer_type, AVFrame* frame, const std::string& outputPath);
#ifdef HAVE_TOPS_FFMPEG
    bool memory_opencv_save(bool is_gpu, void* data, size_t size, std::vector<int64_t> shape, TopsInference::DataType dtype, const std::string& outputPath);
#endif
}



#endif //UTILS_H
